package cn.ncupyh.StudentUtil;

import java.util.ArrayList;

public class StudentTest {
    public static void main(String[] args) {
        //需求:定义一个集合，用于存储3个学生对象
        // 学生类的属性为:name、age、gender
        // 定义一个工具类，用于获取集合中最大学生的年龄。
        ArrayList<Student> students = new ArrayList<>();
        Student stu1 = new Student("zhangsan",20,"boy");
        Student stu2 = new Student("lisi",13,"girl");
        Student stu3 = new Student("cuihua",23,"boy");
        students.add(stu1);
        students.add(stu2);
        students.add(stu3);
        Student maxAge = StudentUtil.findMaxAge(students);
        System.out.println(maxAge);

    }
}
